// RegExp string

// 构造函数声明法
let reg1: RegExp = new RegExp("sanday")
console.log(reg1)  // /sanday/

let reg2: RegExp = new RegExp("sanday", 'gi')

// 字面量声明法
let reg3: RegExp = /sanday/
let reg4: RegExp = /sanday/gi

let test: string = 'didisandaydididi'
let result: boolean = reg1.test(test)
// 报错
let result2: any = reg4.exec(test)
console.log(result)  //true
console.log(result2)  //[ 'sanday', index: 4, input: 'didisandaydididi', groups: undefined ]

export {}